import java.util.Scanner;

// 本质就是斐波那契数列
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int a = 1;
            int b = 1;
            int c = 1;
            int count = 3;
            if(n > 2) {
                while(count <= n) {
                    c = a + b;
                    a = b;
                    b = c;
                    count++;
                }
            }
            System.out.println(c);
        }
    }
}
